{if $param['type']=='template'}
    {if empty($data['row'])}
    <div class="col-sm-12 text-center">—— {:lang("No data")} ——</div>
    {else /}
        {volist name="data['row']" id="vo"}
        <div class="col-sm-6 col-md-4 col-lg-4 col-xl-3">
            <div class="card">
                <a href="{$vo.url}" target="_blank">
                    <img src="{$vo.image}" class="card-img-top" title="{:lang('Click me to go to details')}" data-toggle="tooltip">
                </a>
                <div class="card-body">
                    <h5 class="card-title" title="{$vo.title}" data-toggle="tooltip">{$vo.title}</h5>
                    {if $vo['price']<=0}
                    <p class="card-text text-sm text-primary">{:lang("Free")}</p>
                    {else /}
                    <p class="card-text text-danger">¥ {$vo['price']}</p>
                    {/if}
                    <div class="clearfix">
                        <div class="float-left">
                            {if !$vo['is_install']}
                                <!--未安装-->
                                {if $vo['price']<=0 || $vo['ispaid']==1}
                                <div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
                                    <a href="#" class="btn btn-primary btn-install btn-sm" data-name="{$vo['name']}" title="{:lang('Install the latest version')}" data-toggle="tooltip" data-trigger="hover">{:lang("Install")}</a>
                                    {if !empty($vo['version']) && count($vo['version'])>1}
                                    <button type="button" class="btn btn-primary dropdown-toggle" title="{:lang('Install the specified version')}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
                                    <div class="dropdown-menu">
                                        {volist name="vo['version']" id="v"}
                                        <a class="dropdown-item btn-install" href="#" data-name="{$vo['name']}" data-version="{$v}">{$v}</a>
                                        {/volist}
                                    </div>
                                    {/if}
                                </div>
                                {else /}
                                <a href="{$vo.url}" class="btn btn-warning btn-sm text-white" data-name="{$vo['name']}" target="_blank" title="{:lang('Price')}">{:lang("Go to pay")}</a>
                                {/if}
                            {else /}
                                <a href="#" class="btn btn-danger btn-uninstall btn-sm" data-name="{$vo['name']}" data-type="{$vo['type']}" data-module="{$vo['module']}" data-trigger="hover" data-toggle="tooltip">{:lang("Uninstall")}</a>&nbsp;
                                <!--更新-->
                                {if !empty($vo['version']) && $vo['upgradeData']!==false}
                                <div class="btn-group btn-group-sm" role="group" aria-label="Basic example">
                                    <a href="#" class="btn btn-primary btn-upgrade" data-name="{$vo['name']}" title="{:lang('Update to')}{$vo['upgradeData'][0]}" data-trigger="hover" data-toggle="tooltip">{:lang('Update')}</a>
                                    {if count($vo['upgradeData'])>1}
                                    <button type="button" class="btn btn-primary dropdown-toggle" title="{:lang('Update the specified version')}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
                                    <div class="dropdown-menu">
                                        {volist name="vo['upgradeData']" id="v"}
                                        <a class="dropdown-item btn-upgrade" href="#" data-name="{$vo['name']}" data-version="{$v}">{$v}</a>
                                        {/volist}
                                    </div>
                                    {/if}
                                </div>
                                {/if}
                            {/if}
                        </div>
                        <div class="float-right footer-fa">
                            <span><i class="fas fa-user-alt"></i> {$vo.author}</span> &nbsp;&nbsp;
                            <span><i class="fas fa-calendar-alt"></i> {$vo.publishtime}</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {/volist}
    {/if}
{else /}
<div class="col-md-12">
    <table class="table table-bordered table-hover table-striped">
        <thead>
        <tr>
            <th>
                <div class="th-inner ">{:lang("Serial number")}</div>
                <div class="fht-cell"></div>
            </th>
            <th>
                <div class="th-inner ">{:lang("Name")}</div>
                <div class="fht-cell"></div>
            </th>
            <th>
                <div class="th-inner ">{:lang("Cover")}</div>
                <div class="fht-cell"></div>
            </th>
            <th>
                <div class="th-inner ">{:lang("Introduce")}</div>
                <div class="fht-cell"></div>
            </th>
            <th>
                <div class="th-inner ">{:lang("Author")}</div>
                <div class="fht-cell"></div>
            </th>
            <th>
                <div class="th-inner ">{:lang("Price")}</div>
                <div class="fht-cell"></div>
            </th>
            <th>
                <div class="th-inner ">{:lang("Version")}</div>
                <div class="fht-cell"></div>
            </th>
            <th>
                <div class="th-inner ">{:lang("Status")}</div>
                <div class="fht-cell"></div>
            </th>
            <th>
                <div class="th-inner ">{:lang("Operate")}</div>
                <div class="fht-cell"></div>
            </th>
        </tr>
        </thead>
        <tbody>
        {if empty($data['row'])}
        <tr><td colspan="9">{:lang("No data")}</td></tr>
        {else /}
            {volist name="data['row']" id="v"}
            <tr>
                <td>{$i}</td>
                <td><a href="{$v.url}" class="text-primary" target="_blank">{$v.title}</a></td>
                <td><a href="{$v.image|default='/static/common/nopic.png'}" target="_blank"><img src="{$v.image|default='/static/common/nopic.png'}" style="width: 40px"></a></td>
                <td>{$v.description|default=''}</td>
                <td>{$v.author}</td>
                <td>{if $v.price<=0}<span class="text-primary">{:lang("Free")}</span>{else /}<span class="text-danger">¥ {$v.price}</span>{/if}</td>
                <td>{if !$v['is_install']}{:lang('Not Installed')}{else /}{$v['installVersion']}{/if}</td>
                <td>
                    {if $v['is_install']}
                    <div class="custom-control custom-switch custom-switch-on-teal" data-toggle="tooltip" data-trigger="hover" data-placement="top" title="{:lang("Click to switch")}">
                        <input type="checkbox" class="custom-control-input" data-name="{$v.name|default=''}" id="customSwitch{$v.name}" {$v['status']==1?'checked':''} value="{$v['status']}">
                        <label class="custom-control-label" for="customSwitch{$v.name}"></label>
                    </div>
                    {else /}
                    -
                    {/if}
                </td>
                <td>
                    {if !$v['is_install']}
                        {if $v['price']<=0 || $v['ispaid']==1}
                        <div class="btn-group btn-group-xs" role="group" aria-label="Basic example">
                            <a href="#" class="btn btn-primary btn-install btn-xs" data-name="{$v['name']}" title="{:lang('Install the latest version')}" data-toggle="tooltip" data-trigger="hover">{:lang("Install")}</a>
                            {if !empty($v['version']) && count($v['version'])>1}
                            <button type="button" class="btn btn-primary dropdown-toggle" title="{:lang('Install the specified version')}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
                            <div class="dropdown-menu">
                                {volist name="v['version']" id="vv"}
                                <a class="dropdown-item btn-install" href="#" data-name="{$v['name']}" data-version="{$vv}">{$vv}</a>
                                {/volist}
                            </div>
                            {/if}
                        </div>
                        {else /}
                        <a href="{$v.url}" class="btn btn-warning btn-xs text-white" target="_blank" title="{:lang('Go to pay')}">{:lang('buy')}</a>
                        {/if}
                    {else /}
                        <a href="#" class="btn btn-danger btn-uninstall btn-xs" data-name="{$v['name']}" data-type="{$v['type']}" data-module="{$v['module']}" data-trigger="hover" data-toggle="tooltip">{:lang("Uninstall")}</a>&nbsp;
                        <!--更新-->
                        {if !empty($v['version']) && $v['upgradeData']!==false}
                        <div class="btn-group btn-group-xs" role="group" aria-label="Basic example">
                            <a href="#" class="btn btn-primary btn-upgrade btn-xs" data-name="{$v['name']}" title="{:lang('Update to')}{$v['upgradeData'][0]}" data-trigger="hover" data-toggle="tooltip">{:lang("Update")}</a>
                            {if count($v['upgradeData'])>1}
                            <button type="button" class="btn btn-primary dropdown-toggle" title="{:lang('Update the specified version')}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
                            <div class="dropdown-menu">
                                {volist name="v['upgradeData']" id="vv"}
                                <a class="dropdown-item btn-upgrade" href="#" data-name="{$v['name']}" data-version="{$vv}">{$vv}</a>
                                {/volist}
                            </div>
                            {/if}
                        </div>
                        {/if}
                    {/if}
                </td>
            </tr>
            {/volist}
        {/if}
        </tbody>
    </table>
</div>
{/if}